#pragma once

#include <memory>
#include <string>
#include <vector>

#include "LogLevel.h"
#include "LogAppender.h"
#include "LogEvent.h"
#include "utils/Mutex.h"

namespace log
{

class Logger
{
public:
    using ptr = std::shared_ptr<Logger>;

    Logger(const std::string& name);
    std::string getName() const { return m_strName; }
    LogLevel::ELevel getLevel() const { return m_eLevel; }
    void setName(std::string name) { m_strName = name; }
    void setLevel(LogLevel::ELevel eLevel) { m_eLevel = eLevel; }
    void addAppender(LogAppender::ptr ptrAppend);
    void setAppender(std::vector<LogAppender::ptr> vecApps);
    std::vector<LogAppender::ptr> getAppender();
    void log(LogEvent::ptr ptrEvent);

private:
    std::string m_strName;
    LogLevel::ELevel m_eLevel;
    utils::Mutex m_mutex;
    std::vector<LogAppender::ptr> m_vecApps;
};
    
} // namespace log
